﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataModels;
using Common;
using DataAccess;

namespace BusinessLogic
{
    public class SecurityBusinessLogic : BusinessLogicBase
    {
        public bool Register(Security security)
        {
            security.Password = Utils.ToMD5(security.Password);

            return GetDataAccess<ISecurityDataAccess>().Register(security);
        }

        public Person Login(string username, string password)
        {
            password = Utils.ToMD5(password);

            return GetDataAccess<ISecurityDataAccess>().Login(username, password);
        }
    }
}
